<extend name="Public/base"/>
<block name="body">
    <div class="row">
        <div class="col-md-12">
            <div class="portlet box blue">
                <div class="portlet-title">
                    <div class="caption"><i class="fa fa-reorder"></i>添加年级考试</div>
                    <div class="tools">
                        <a href="javascript:;" class="collapse"></a>
                        <a href="#portlet-config" data-toggle="modal" class="config"></a>
                        <a href="javascript:;" class="reload"></a>
                        <a href="javascript:;" class="remove"></a>
                    </div>
                </div>
                <div class="portlet-body form">
                    <form class="form-horizontal exma_form" action="{:U('')}" method="post">
                        <div class="form-body">
                            <div class="alert alert-info"><strong>考试信息</strong></div>

                            <div class="form-group col-md-6">
                                <label class="control-label col-md-4">考试名称</label>
                                <div class="col-md-8">
                                    <input type="text" name="exam_name" class="form-control"/>
                                </div>
                            </div>
                            <div class="form-group col-md-6">
                                <label class="control-label col-md-4">考试类别</label>
                                <div class="col-md-8">
                                    <select name="exam_category" class="form-control">
                                        <option value="">请选择</option>
                                        <volist name="cate_list" id="vo">
                                            <if condition="$vo.type_id eq 2">
                                                <option value="{$vo.cate_name}">{$vo.cate_name}</option>
                                            </if>
                                        </volist>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group col-md-6">
                                <label class="control-label col-md-4">考试时间</label>
                                <div class="col-md-8">
                                    <div class="input-group date form_datetime">
                                        <input name="exam_time" type="text" size="16" readonly class="form-control">
												<span class="input-group-btn">
                                                    <button class="btn default date-set" type="button">
                                                        <i class="fa fa-calendar"></i>
                                                    </button>
												</span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group col-md-6">
                                <label class="control-label col-md-4">考试难度</label>
                                <div class="col-md-8">
                                    <select name="exam_difficulty" class="form-control">
                                        <option value="">请选择</option>
                                        <volist name="cate_list" id="vo">
                                            <if condition="$vo.type_id eq 1">
                                                <option value="{$vo.cate_name}">{$vo.cate_name}</option>
                                            </if>
                                        </volist>

                                    </select>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                            <div class="alert alert-info"><strong>各科及格分数线</strong></div>
                            <div class="score">
                                <div class="form-group col-md-6">
                                    <label class="control-label col-md-4"></label>
                                    <div class="col-md-8">
                                        <select name="subject_name[]" class="form-control">
                                            <option>请选择考试科目</option>
                                            <volist name="sub_list" id="vo">
                                                <option value="{$vo.subject_name}">{$vo.subject_name}</option>
                                            </volist>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group col-md-6">
                                    <div class="col-md-5">
                                        <select name="difficulty[]" class="form-control">
                                            <option value="">请选择考试难度</option>
                                            <volist name="cate_list" id="vo">
                                                <if condition="$vo.type_id eq 1">
                                                    <option value="{$vo.cate_name}">{$vo.cate_name}</option>
                                                </if>
                                            </volist>

                                        </select>
                                    </div>
                                    <div class="col-md-5">
                                        <input class="form-control"  name="pass_nubmer[]" type="text" placeholder="请输入及格分数线"/>
                                    </div>
                                    <div class="col-md-1 addscore">
                                        <i style="cursor: pointer;" class="fa fa-plus-square text-success margin-top-10"></i>
                                    </div>
                                    <div class="col-md-1 cutscore">
                                        <i style="cursor: pointer;" class="fa fa-minus-square text-danger margin-top-10"></i>
                                    </div>
                                </div>
                            </div>
                            <div class="scorebox">

                                <!--在此div中添加各科考试选项-->

                            </div>


                            <div class="clearfix"></div>
                            <hr/>
                            <div class="form-group col-md-6">
                                <label class="control-label col-md-4">是否加入学生成绩分析</label>
                                <div class="col-md-8">
                                    <div class="radio-list">
                                        <label class="radio-inline">
                                            <input type="radio" value="1" name="grade_id" checked>是
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" value="0" name="grade_id">否
                                        </label>
                                    </div>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                            <div class="form-group col-md-12">
                                <label class="control-label col-md-2">考试说明</label>
                                <div class="col-md-10">
                                    <textarea rows="3" class="form-control" name="explains"></textarea>
                                </div>
                            </div>

                        </div>
                        <input type="hidden" name="gid" value="{$_GET[gid]}"/>
                        <div class="clearfix"></div>
                        <div class="form-actions fluid">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="col-md-offset-3 col-md-6">
                                        <button type="submit" target-form="exma_form" class="ajax-post btn green">确定</button>
                                        <button type="button" onclick="javascript:history.back(-1);return false;" class="btn default">返回</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</block>
<block name="script">
    <script type="text/javascript" src="__STATIC__/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
    <script type="text/javascript" src="__STATIC__/plugins/bootstrap-datepicker/js/locales/bootstrap-datepicker.zh-CN.js"></script>
    <script type="text/javascript" src="__STATIC__/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="__STATIC__/plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <script src="__STATIC__/scripts/form-components.js"></script>
    <script src="__STATIC__/scripts/app.js"></script>
    <script>
        jQuery(document).ready(function() {
            App.init();
            highlight_subnav('{:U('User/gradeInformation')}');
            FormComponents.init();

            var scoreitem=$('.score').prop("outerHTML");
            $("body").on('click','.addscore',function(){ //删除难易选项
                $('.scorebox').append(scoreitem);
            }).on('click','.cutscore',function(){ //删除难易选项
                $(this).parents('.score').remove();
            });


        });

    </script>
</block>